package com.itzhanshen.easyexcel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import lombok.extern.slf4j.Slf4j;

import java.util.ArrayList;
import java.util.List;

public class EmpParseListener extends AnalysisEventListener<Emp> {
    List<Emp> emps = new ArrayList<>();
    @Override
    public void invoke(Emp data, AnalysisContext context) {
        System.out.println("读取的内容:" + data);
        emps.add(data);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext context) {
        System.out.println("已读取完毕");
        emps.forEach(emp -> System.out.println(emp));

    }
}
